using System;
using UnityEngine;

[Serializable]
public class GotchaReward
{
	public string id;

	public GotchaRewardType type;

	public int amount;

	public float cost;

	[HideInInspector]
	public float weight;

	public void Init(float cost, GotchaRewardType type, string id, int amount)
	{
		this.type = type;
		this.id = id;
		this.amount = amount;
		this.cost = cost;
	}

	public void GiveReward()
	{
		switch (type)
		{
		case GotchaRewardType.Cash:
			settings.ShowSpecialLabelWithAnimation(amount, Vector3.zero, false);
			break;
		case GotchaRewardType.Gold:
			settings.ShowLabelWithAnimation(amount, Vector3.zero, false);
			break;
		case GotchaRewardType.Product:
		{
			Product product = MarketController.Instance.GetProduct(id);
			MarketController.Instance.BuyProduct(product, true, amount);
			MarketController.Instance.EquipBetter(product);
			break;
		}
		}
	}
}
